feat: Add methods for setting max message size limits (i.e., MTU negotiation) [MTT-6214]#2530
Merged
ShadauxCat merged 7 commits intodevelopfrom May 24, 2023
Merged
Conversation
0xFA11
reviewed
Apr 27, 2023
0xFA11
reviewed
Apr 27, 2023
Comment on lines
+583
to
+596
| /// <summary> | ||
| /// Sets the maximum size of a single non-fragmented message (or message batch) passed through the transport. | ||
| /// This should represent the transport's MTU size, minus any transport-level overhead. | ||
| /// </summary> | ||
| /// <param name="size"></param> | ||
| public void SetMaxSingleMessageSize(int size) => MessageManager.SetMaxSingleMessageSize(size); | ||
|
|
||
| /// <summary> | ||
| /// Sets the maximum size of a message (or message batch) passed through the transport with the ReliableFragmented delivery. | ||
| /// Warning: setting this value too low may result in the SDK becoming non-functional with projects that have a large number of NetworkBehaviours or NetworkVariables, as the SDK relies on the transport's ability to fragment some messages when they grow beyond the MTU size. | ||
| /// </summary> | ||
| /// <param name="size"></param> | ||
| public void SetMaxFragmentedMessageSize(int size) => MessageManager.SetMaxFragmentedMessageSize(size); | ||
|
|
Contributor
There was a problem hiding this comment.
2 things:
- I'd suggest
get; set;property here (so that users could get the value without setting it) - I'd suggest naming these APIs as
int MaximumTransmissionUnitSize { get; set; }&int MaximumFragmentedMessageSize { get; set; }because it looks like they boil down to those two concepts.
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds new APIs. Do not merge until after the release/1.4.1 branch has been created.
resolves #2431
Changelog
NetworkManager.SetMaxSingleMessageSize()andNetworkManager.SetMaxFragmentedMessageSize()for transports that don't work with the default valuesTesting and Documentation